# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7688c6c>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7688f0c>}
nname: 161
n 161(None)[]:
	i: 50(), 107()
	o: 

nname: 107
n 107(None)[self.on = functools.partial(fcntl.ioctl, fd, 10)
self.off = functools.partial(fcntl.ioctl, fd, 11)
]:
	i: 3(), 105(AE)
	o: 161()

nname: 105
n 105(None)[]:
	i: 40(f)
	o: 107(AE)

nname: 50
n 50(None)[#, e
log.error("Can't load Led subsystem: %s", str(e))
def self.on():
	return None

def self.off():
	return None

]:
	i: 40(t)
	o: 161()

nname: 40
n 40(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 0(except)
	o: 50(t), 105(f)

nname: 3
n 3(None)[self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
fd = self._WyLed__wyled0.fileno()
]:
	i: 0(try)
	o: 107()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 40(except)

nname: 161
n 161(None)[]:
	i: 50(), 107(), 40(f)
	o: 

nname: 50
n 50(None)[#, e
log.error("Can't load Led subsystem: %s", str(e))
def self.on():
	return None

def self.off():
	return None

]:
	i: 40(t)
	o: 161()

nname: 40
n 40(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 0(except)
	o: 50(t), 161(f)

nname: 107
n 107(None)[self.on = functools.partial(fcntl.ioctl, fd, 10)
self.off = functools.partial(fcntl.ioctl, fd, 11)
]:
	i: 3(), 105(AE)
	o: 161()

nname: 3
n 3(None)[self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
fd = self._WyLed__wyled0.fileno()
]:
	i: 0(try)
	o: 107()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 40(except)

nname: 161
n 161(None)[]:
	i: 40()
	o: 

nname: 40
n 40(None)[except Exception, e:
	log.error("Can't load Led subsystem: %s", str(e))
	def self.on():
		return None

	def self.off():
		return None

else:
	self.on = functools.partial(fcntl.ioctl, fd, 10)
	self.off = functools.partial(fcntl.ioctl, fd, 11)
]:
	i: 0()
	o: 161()

nname: 0
n 0(None)[try:
	self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
	fd = self._WyLed__wyled0.fileno()
]:
	i: 
	o: 40()

nname: 161
n 161(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[try:
	self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
	fd = self._WyLed__wyled0.fileno()
except Exception, e:
	log.error("Can't load Led subsystem: %s", str(e))
	def self.on():
		return None

	def self.off():
		return None

else:
	self.on = functools.partial(fcntl.ioctl, fd, 10)
	self.off = functools.partial(fcntl.ioctl, fd, 11)
]:
	i: 
	o: 161()

nname: 0
n 0(None)[try:
	self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
	fd = self._WyLed__wyled0.fileno()
except Exception, e:
	log.error("Can't load Led subsystem: %s", str(e))
	def self.on():
		return None

	def self.off():
		return None

else:
	self.on = functools.partial(fcntl.ioctl, fd, 10)
	self.off = functools.partial(fcntl.ioctl, fd, 11)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb768852c>}
nname: 0
n 0(None)[wdb = pygui_globs['wydbus']
self.ask_standby = wdb.signal('/com/wyplay/wycrs/wylight', 'standbyAsked', '')
self.ask_standby()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7684cac>}
nname: 0
n 0(None)[wdb = pygui_globs['wydbus']
self.ask_led_action = wdb.signal('/com/wyplay/wycrs/wylight', 'callLedAction', 'i')
self.ask_led_action(action_id)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7684c8c>}
nname: 6
n 6(None)[__doc__ = ' Switches leds on or off '
__metaclass__ = MetaSingleton
def __init__(self):
	try:
		self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
		fd = self._WyLed__wyled0.fileno()
	except Exception, e:
		log.error("Can't load Led subsystem: %s", str(e))
		def self.on():
			return None

		def self.off():
			return None

	else:
		self.on = functools.partial(fcntl.ioctl, fd, 10)
		self.off = functools.partial(fcntl.ioctl, fd, 11)

def ask_standby(self):
	wdb = pygui_globs['wydbus']
	self.ask_standby = wdb.signal('/com/wyplay/wycrs/wylight', 'standbyAsked', '')
	self.ask_standby()

def ask_led_action(self, action_id):
	wdb = pygui_globs['wydbus']
	self.ask_led_action = wdb.signal('/com/wyplay/wycrs/wylight', 'callLedAction', 'i')
	self.ask_led_action(action_id)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb768460c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.misc_utils import MetaSingleton
from pygui.shared import pygui_globs
import functools
import fcntl
log = GET_LOGGER(__name__)
class WyLed(object):
	__doc__ = ' Switches leds on or off '
	__metaclass__ = MetaSingleton
	def __init__(self):
		try:
			self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
			fd = self._WyLed__wyled0.fileno()
		except Exception, e:
			log.error("Can't load Led subsystem: %s", str(e))
			def self.on():
				return None

			def self.off():
				return None

		else:
			self.on = functools.partial(fcntl.ioctl, fd, 10)
			self.off = functools.partial(fcntl.ioctl, fd, 11)

	def ask_standby(self):
		wdb = pygui_globs['wydbus']
		self.ask_standby = wdb.signal('/com/wyplay/wycrs/wylight', 'standbyAsked', '')
		self.ask_standby()

	def ask_led_action(self, action_id):
		wdb = pygui_globs['wydbus']
		self.ask_led_action = wdb.signal('/com/wyplay/wycrs/wylight', 'callLedAction', 'i')
		self.ask_led_action(action_id)



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb767ceac>}
from __future__ import absolute_import
from peewee.debug import GET_LOGGER
from peewee.misc_utils import MetaSingleton
from pygui.shared import pygui_globs
import functools
import fcntl
log = GET_LOGGER(__name__)
class WyLed(object):
	__doc__ = ' Switches leds on or off '
	__metaclass__ = MetaSingleton
	def __init__(self):
		try:
			self._WyLed__wyled0 = file('/dev/wyled0', 'rw')
			fd = self._WyLed__wyled0.fileno()
		except Exception, e:
			log.error("Can't load Led subsystem: %s", str(e))
			def self.on():
				return None

			def self.off():
				return None

		else:
			self.on = functools.partial(fcntl.ioctl, fd, 10)
			self.off = functools.partial(fcntl.ioctl, fd, 11)

	def ask_standby(self):
		wdb = pygui_globs['wydbus']
		self.ask_standby = wdb.signal('/com/wyplay/wycrs/wylight', 'standbyAsked', '')
		self.ask_standby()

	def ask_led_action(self, action_id):
		wdb = pygui_globs['wydbus']
		self.ask_led_action = wdb.signal('/com/wyplay/wycrs/wylight', 'callLedAction', 'i')
		self.ask_led_action(action_id)



